import axios from 'axios'
//设置服务器基本ip路径
axios.defaults.baseURL='http://192.168.0.102:5000'
export default axios //暴露axios,
export let getYYYYMMDDhhmmss = (datastr) => { //获取年-月-日 时:分:秒时间格式
    let d = new Date(datastr)
    return d.getFullYear() + '-' + mathzero((d.getMonth() + 1)) + '-' + mathzero(d.getDate())+' '+ mathzero(d.getHours()) + ':' +mathzero(d.getMinutes())  + ':' +mathzero(d.getSeconds()) 
}
//补0函数
export let mathzero = num => (num < 10 ? '0' + num : num)